package config

import (
	"shop/entity"
	"time"
)

var Conf *sysConfig
var MerchantConfs []MerchantConfig
var SysRoles []entity.SysRole

func Init() {
	Conf = loadSysConfig()
	MerchantConfs = loadShopConfigs()
	SysRoles = loadSysRoleList()
	go func() {
		// 定时拉取配置
		for {
			time.Sleep(1 * time.Minute)

			MerchantConfs = loadShopConfigs()
			SysRoles = loadSysRoleList()
		}
	}()
}
